package com.jiang.daily.Q3541;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/09/15 16:30
 */
class Solution {
    public int maxFreqSum(String s) {
        // Set<Character> set = Set.of('a', 'e', 'i', 'o', 'u');
        int vowel = 0;
        int consonant = 0;
        int[] arr = new int[26];
        for (char c: s.toCharArray()) {
            arr[c - 'a']++;
            if ("aeiou".indexOf(c) == -1) {
                consonant = Math.max(consonant, arr[c - 'a']);
            } else {
                vowel = Math.max(vowel, arr[c - 'a']);
            }
        }
        return consonant + vowel;
    }
}
